<template>
    <div class="app">
        <HeaderComp title="定位地址" class="head-top" />
        <div class="content">
            <iframe id="mapPage" width="100%" height="100%" frameborder=0
              src="http://apis.map.qq.com/tools/locpicker?search=1&type=1&key=OB4BZ-D4W3U-B7VVO-4PJWW-6TKDJ-WPB77&referer=myapp">
            </iframe>
        </div>
    </div>
</template>

<script>
export default {
    name: "locationAddress",
    components: {
        HeaderComp: () => import("@/components/HeaderComps"),
    },
    data() {
        return {
            
        };
    },
    mounted() {
      var that = this
      window.addEventListener('message', function (event) {
        var loc = event.data
        if (loc && loc.module == 'locationPicker') {
          that.$store.commit("setBizArea", {
            bizAreaId: [],
            bizAreaText: loc.poiaddress.split('区')[0],
          });
          that.$store.commit("ISetMerchantAddress", loc.poiaddress);
          setTimeout(() => {
            that.$router.go(-1);
          }, 300);
        }
      }, false)

    },
    methods: {

    },
};
</script>

<style lang="less" scoped>
.app {
    background: #f9f9f9;
    height: 100vh;
    width: 100vw;
    box-sizing: border-box;
    padding-top: 120px;
}
.content {
    height: 100%;
}
</style>
